package cn.edu.scnu.report.mapper;

import cn.edu.scnu.report.entity.MovieReport;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ReportMapper {

    @Select("SELECT\n" +
            "    ROW_NUMBER() OVER (ORDER BY total_hits DESC) AS ranks,\n" +
            "    title, type, total_hits, director\n" +
            "FROM movies\n" +
            "ORDER BY total_hits DESC;")
    List<MovieReport> getMovieData();
}
